<template>
    <view class="good_empty" @touchmove.stop.prevent="() => {}">
        <view class="empty_img">
            <image :src="props.icon" />
        </view>
        <view class="empty_text">{{ props.text }}</view>
        <view class="empty_btn" @click="toHome">回到首页</view>
    </view>
</template>

<script setup>
import router from '@/router';
import { getImgOssUrl } from '@/commons/utils';

const props = defineProps({
    text: { type: String, default: '商品不存在' },
    icon: { type: String, default: getImgOssUrl('/ui-prod-2.3.0/empty-addr@2x.png') }
});
const toHome = () => {
    router.switchTab({ url: '/pages/tabbar/home' });
};
</script>

<style lang="scss" scoped>
.good_empty {
    padding-top: 342rpx;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: #fff;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    .empty_img {
        width: 297rpx;
        height: 216rpx;
        margin-bottom: 27rpx;
        image {
            width: 100%;
            height: 100%;
        }
    }
    .empty_text {
        margin-bottom: 43rpx;
        font-size: 29rpx;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #333333;
    }
    .empty_btn {
        width: 203rpx;
        height: 65rpx;
        border-radius: 40rpx;
        border: 2rpx solid #fe292b;
        background-color: #ffffff;
        color: #fe292b;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        line-height: 65rpx;
        text-align: center;
        font-size: 29rpx;
    }
}
</style>
